package com.weimei.conversionTreasure.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.chad.library.BR;
import com.weimei.conversionTreasure.R;
import com.weimei.conversionTreasure.databinding.ActivityFeedBackBinding;
import com.weimei.conversionTreasure.utils.ValidateUtils;
import com.weimei.conversionTreasure.viewModel.TitleVM;

import me.goldze.mvvmhabit.base.BaseActivity;
import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.utils.ToastUtils;

public class FeedBackActivity extends BaseActivity<ActivityFeedBackBinding, TitleVM> {


    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_feed_back;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public void initData() {
        super.initData();
        viewModel.setTitleText("意见反馈");
        binding.tvSubmit.setOnClickListener(view -> {
            if (ValidateUtils.isEmptyString(binding.edtTitle.getText().toString())){
                ToastUtils.showShort("请输入标题");
                return;
            }

            if (ValidateUtils.isEmptyString(binding.edtContent.getText().toString())){
                ToastUtils.showShort("请输入标题");
                return;
            }

            ToastUtils.showShort("提交成功");

        });
    }
}